﻿using System.Data;
using System.Data.SqlClient;

namespace APdal
{
    public class dataLink
    {
        #region "Declarações"

        public static SqlConnection conn;
        private string _conStr;
        private readonly frmSql _frmSql;

        #endregion

        public dataLink()
        {
            conn = new SqlConnection();
            
            _conStr = Properties.Settings.Default.appConStr;
            conn.ConnectionString = _conStr;            

            try
            {
                conn.Open();                
                conn.Close();
            }
            catch
            {
                _frmSql = new frmSql();
                _frmSql.ShowDialog();
            }
        }

        public string conStr
        {
            get { return _conStr; }
            set { _conStr = value; }
        }
    }
}